package com.nie.mybatisPlus.generator.system.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;

/**
 * 温mvc配置
 *
 * @author nie_cq
 * @date 2022/11/23
 */
@Configuration
public class WebMvcConfigurer implements org.springframework.web.servlet.config.annotation.WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(tenantContextHandlerInterceptor()).addPathPatterns("/**");
        org.springframework.web.servlet.config.annotation.WebMvcConfigurer.super.addInterceptors(registry);
    }

    protected TenantContextHandlerInterceptor tenantContextHandlerInterceptor() {
        return new TenantContextHandlerInterceptor();
    }
}
